﻿///////////////////////////////////////////////////////
//
// XDesigner.ORM 
//
// autohr : yuans
//
// date: 2011-2-23
//
// email  : yyf9989@hotmail.com
// 
//
///////////////////////////////////////////////////////

using System;
using System.Text;

namespace XDesigner.ORM
{
    /// <summary>
    /// Attribute special information binding data base field.
    /// </summary>
    [AttributeUsage( AttributeTargets.Property )]
    public class ORMFieldAttribute : Attribute
    {
        /// <summary>
        /// Initialize instance
        /// </summary>
        public ORMFieldAttribute()
        {
        }

        /// <summary>
        /// Initialize instance
        /// </summary>
        /// <param name="fieldName">data base field name</param>
        public ORMFieldAttribute(string fieldName)
        {
            strFieldName = fieldName;
        }

        private string strFieldName = null;
        /// <summary>
        /// Data base field name
        /// </summary>
        public string FieldName
        {
            get
            {
                return strFieldName;
            }
            set
            {
                strFieldName = value;
            }
        }

        private string _ComparabilityFieldName = null;

        public string ComparabilityFieldName
        {
            get
            {
                return _ComparabilityFieldName;
            }
            set
            { 
                _ComparabilityFieldName = value; 
            }
        }

        private string _ComparabilityFieldName2 = null;

        public string ComparabilityFieldName2
        {
            get
            { 
                return _ComparabilityFieldName2;
            }
            set
            { 
                _ComparabilityFieldName2 = value;
            }
        }

        private string _Format = null;

        public string Format
        {
            get
            { 
                return _Format;
            }
            set
            {
                _Format = value; 
            }
        }

        private ORMBooleanValue _ExtCondition = ORMBooleanValue.Default;

        public ORMBooleanValue ExtCondition
        {
            get
            {
                return _ExtCondition; 
            }
            set
            {
                _ExtCondition = value; 
            }
        }

        private ORMDBValueType _DBValueType = ORMDBValueType.Default;

        public ORMDBValueType DBValueType
        {
            get { return _DBValueType; }
            set { _DBValueType = value; }
        }

        //private BooleanValue _Nullable = BooleanValue.True;

        //public BooleanValue Nullable
        //{
        //    get { return _Nullable; }
        //    set { _Nullable = value; }
        //}
    }
}
